package org.yefei.homeworkday21;

import java.util.Scanner;

public class Preview {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入第一个字符串：");
		String str = in.next();
		System.out.println("输入第二个字符串：");
		String str1 = in.next();
		String[] ss = new String[str.length()];
		int count = 0;
		for (int i = 0; i < ss.length; i++) {
			ss[i] = str.substring(i, i + 1);
			if (ss[i].equals(str1)) {
				count++;
			}
		}
		System.out.println(str1 + "  在  " + str + "  中出现  " + count + "  次。");
	}

}
